home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE3 / SCRIBBLE / Examples / arthur next >
Text File  |  2002-09-06  |  2KB  |  62 lines

  1.  
  2. verse1 = {
  3.           "When good king Arthur ruled the land",
  4.           "he was a goodly king.",
  5.           "He stole three pecks of barley rye",
  6.           "to make a bag pudding." 
  7.         } 
  8.         
  9. verse2 = {
  10.            "A bag pudding the king did make",
  11.            "and stuffed it full of plums,",
  12.            "and in it put great lumps of fat",
  13.            "as big as my two thumbs."
  14.          } 
  15.          
  16. verse3 = {
  17.            "The king and queen did eat thereof",
  18.            "and noblemen beside,",
  19.            "and what they could not eat that night",
  20.            "the queen next morning fried."
  21.          } 
  22.                       
  23. x = BEGIN(arg[1].."/pdf")
  24.  
  25. x.red =  function (self)
  26.             return self:setcolor("both","rgb",1,0,0,0)
  27.           end -- function
  28.  
  29. x.green = function (self)
  30.             return self:setcolor("both","rgb",0,1,0,0)
  31.           end -- function
  32.           
  33. x.blue =  function (self)
  34.             return self:setcolor("both","rgb",0,0,1,0)
  35.           end -- function  
  36.  
  37. x.showlines = function (self,t)
  38.                self:show("")
  39.                for i = 1,getn(t) do
  40.                  self:continue_text(t[i])
  41.                end -- for
  42.               end -- function   
  43.  
  44. x:begin_page(A4.width,A4.height)
  45.  
  46. icon = x:open_image_file("png",arg[1].."/png","",0)
  47. x:place_image(icon,30,350,1)
  48. x:close_image(icon)
  49.  
  50. font = x:findfont("Times-Roman", "host", 0)
  51. x:setfont(font, 14)
  52. x:set_text_pos(300, 700)
  53. x:red()
  54. x:showlines(verse1)
  55. x:green()
  56. x:continue_text(" ")
  57. x:showlines(verse2)
  58. x:blue()
  59. x:continue_text(" ")
  60. x:showlines(verse3)
  61. x:END()
  62.